package cn.yunhe.test;

import cn.yunhe.service.IUserService;
import com.github.pagehelper.Page;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.HashMap;
import java.util.Map;

public class Demo {

    ApplicationContext ac=null;

    @Before
    public void init (){
        ac=new ClassPathXmlApplicationContext("spring/spring-mybatis.xml");
    }


    @Test
    public void test(){
        IUserService userService= (IUserService) ac.getBean("userService");

        Map<String ,Object> map=new HashMap<String ,Object>();

        map.put("pageNum",1);
        map.put("pageSize",5);

        Page page=userService.getLikeUsers(map);

        System.out.println(page);
    }
}
